package com.xz.member.vo;

import com.xz.common.annotation.Excel;
import com.xz.diagnosisOrder.utils.DiagnosisOrderUtils;
import com.xz.member.domain.MemberInfo;
import lombok.Data;

import java.math.BigDecimal;
import java.util.Date;

@Data
public class MemberInfoExportVo{

    /** 会员名称 */
    @Excel(name = "会员名称")
    private String memberName;

    /** 手机号 */
    @Excel(name = "会员卡")
    private String phoneNumber;

    /** 会员等级 */
    @Excel(name = "会员等级")
    private String memberLevel;

    /** 绑定患者 */
    @Excel(name = "绑定患者")
    private String bindingPatients;

    /** 钱包余额 */
    @Excel(name = "钱包余额（元）")
    private BigDecimal walletBalance;

    /** 累计充值 */
    @Excel(name = "累计充值（元）")
    private BigDecimal accumulatedRecharge;

    /** 积分余额 */
    @Excel(name = "积分余额")
    private BigDecimal integralBalance;

    @Excel(name = "注册日期", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    @Excel(name = "注册门店")
    private String deptName;

    public MemberInfoExportVo(MemberInfoVo infoVo) {

        this.memberName = DiagnosisOrderUtils.getPatientInfo(infoVo.getMemberName(),infoVo.getSex(),infoVo.getBirthday());
        this.phoneNumber = infoVo.getPhoneNumber();
        this.memberLevel = infoVo.getMemberLevel();
        this.bindingPatients = infoVo.getBindingPatients();
        this.walletBalance = infoVo.getWalletBalance();
        this.accumulatedRecharge = infoVo.getAccumulatedRecharge();
        this.integralBalance = infoVo.getIntegralBalance();
        this.createTime = infoVo.getCreateTime();
        this.deptName = infoVo.getDeptName();
    }
}
